package com.njtcedu.microblog.intranet.systemconfig.service;

import java.io.IOException;
import java.util.List;

import javax.inject.Inject;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

import com.njtcedu.microblog.intranet.systemconfig.repository.SystemConfigRepository;
import com.njtcedu.microblog.intranet.systemconfig.web.request.AdImagesRequest;
import com.njtcedu.microblog.intranet.systemconfig.web.response.AdImageResponse;

@Service
@Transactional
public class SystemConfigService {

	@Inject
	SystemConfigRepository systemConfigRepository;
	
	public AdImageResponse uploadAdImage(MultipartFile imageFile, String evePath, String imageName) throws IOException {
		return systemConfigRepository.uploadAdImage(imageFile, evePath, imageName);
	}

	public void saveImageInfo(AdImagesRequest request) {
		systemConfigRepository.saveImageInfo(request);
	}
	
	public List<AdImageResponse> getAdImages(){
		return systemConfigRepository.getAdImages();
	}
}
